<%-- 
    Document   : Nusuario
    Created on : 04-sep-2013, 14:04:24
    Author     : pavel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.ptr.ptrsystem.dao.Lista"%>
<%@page import="com.ptr.ptrsystem.bean.*"%>
<%@page import="java.util.LinkedList"%>
<%@page language="java"%>
<%@page session="true" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title> </title>
         <link rel='stylesheet' href='/RegCivil/css/estilos.css'>
         <script src='/RegCivil/js/jquery-2.0.2.js'></script>
         <script src='/RegCivil/js/funciones.js'></script>
         <script src='/RegCivil/js/returnmain.js'></script>
         <script src='/RegCivil/js/jq.js'></script>
         <link rel="stylesheet" type="text/css" href="/RegCivil/css/style-fomularios.css" media="all">
<script>
    $(document).ready
    (
        function()
        {
              $('#ubinac').click(
                    function ()
                    {
                       var dep=$("#dep").val();
                       var prov=$("#prov").val();
                       var dist=$("#dist").val();
                       var otro=$("#otro").val();
                       var ubi=dep+prov+dist+otro;
                       $.get('${pageContext.request.contextPath}/MantenimientoPersona',{ubigeonac:ubi},function(responsetext)
                       {
                           $("#Nubigeo").text(responsetext);
                       });
                    }
              );
              $('#ubidom').click(
                    function ()
                    {
                       var depd=$("#depd").val();var provd=$("#provd").val();
                       var distd=$("#distd").val();var otrod=$("#otrod").val();
                       var ubid=depd+provd+distd+otrod;
                       $.get('${pageContext.request.contextPath}/MantenimientoPersona',{ubigeodom:ubid},function(responsetext)
                       {
                           $("#Nubigeod").text(responsetext);
                       });
                    }
              );
        }
    );
</script>
    </head>
    <body>
        <form action="${pageContext.request.contextPath}/MantenimientoPersona" method="POST" name="form1" class="contacto">
            <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:0px ">
                <tr><td>                    
                        <fieldset style="alignment-baseline: central">
                            <legend style="border: 1px solid #dce0e3;background-color: #edf1f5">
                                REGISTRO DE NUEVO USUARIO</legend>
                             <table border="0">
                                <tr>
                                    <td>
                                        <fieldset><legend><label/>REGISTRO PERSONAL</legend>
                                            <table>
                                                <tr>
                                                    <TD><label/>Cui</td>
                                                    <%String cuiN=(String)request.getAttribute("cuin");if(cuiN!=null){%>
                                                    <td><input type="text" value="<%=cuiN%>" name="cui" size="8" style="width: 10.0em" maxlength="8"></td>
                                                    <%}else{%>
                                                    <td><input type="text" value="" name="cui" size="8" style="width: 10.0em" maxlength="8"></td><%}%>
                                                    <td><label/>Nro Acta</td>
                                                    <%String nroN=(String)request.getAttribute("nron");if(nroN!=null){%>
                                                    <td><input type="text" value="<%=nroN%>" name="nroacta" size="8" style="width: 10.0em" maxlength="8"></td>
                                                    <%}else{%>
                                                    <td><input type="text" name="nroacta" value="" size="8" style="width: 10.0em" maxlength="8"></td><%}%>
                                                    <td><label/>Nro Libro</td>
                                                    <%String nroLN=(String)request.getAttribute("nroln");if(nroLN!=null){%>
                                                    <td><input type="text" value="<%=nroLN%>" name="nrolibro" size="8" style="width: 10.0em" maxlength="8"></td><%}else{%>
                                                    <td><input type="text" value="" name="nrolibro" size="8" style="width: 10.0em" maxlength="8"></td><%}%>
                                                    <td>
                                                        <button type="submit" name="btn1" value="Busuario" size="8" style="width: 10.0em">
                                                            Buscar
                                                        </button>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>DATOS PERSONALES</legend>
                                            <table>
                                                <tr>
                                                    <td><label/>Primer Apellido</td>
                                                    <%String pa=(String)request.getAttribute("ap1");if(pa!=null){%>
                                                    <td><input type="text" value="<%=pa%>" name="pape" size="8" style="width: 10.0em"></td><%}else{%>
                                                    <td><input type="text" value="" name="pape" size="8" style="width: 10.0em"></td><%}%>
                                                    <td><label/>Segundo Apellido</td>
                                                    <%String SapeN=(String)request.getAttribute("sapen");if(SapeN!=null){%>
                                                    <td><input type="text" value="<%=SapeN%>" name="sape" size="8" style="width: 10.0em"></td><%}else{%>
                                                    <td><input type="text" value="" name="sape" size="8" style="width: 10.0em"></td><%}%>
                                                    <td><label/>Apellido Casada</td>
                                                    <%String CapeN=(String)request.getAttribute("capen");if(CapeN!=null){%>
                                                    <td><input type="text" value="<%=CapeN%>" name="apecas" size="8" style="width: 10.0em"></td><%}else{%>
                                                    <td><input type="text" value="" name="apecas" size="8" style="width: 10.0em"></td><%}%>
                                                </tr>
                                                <tr>
                                                    <td><label/>Pre-Nombre (S)</td>
                                                    <%String PnomN=(String)request.getAttribute("pnomn");if(PnomN!=null){%>
                                                    <td><input type="text" value="<%=PnomN%>" name="pnom" size="8" style="width: 10.0em"></td><%}else{%>
                                                    <td><input type="text" value="" name="pnom" size="8" style="width: 10.0em"></td><%}%>
                                                    <td><label/>Genero</td>
                                                    <td>
                                                        <select name="genero" style="padding: 7px 6px;
                                            width: 130px;
                                            border: 1px solid #CED5D7;
                                            resize: none;
                                            box-shadow:0 0 0 3px #EEF5F7;
                                            margin: 5px 0;
                                            text-transform: uppercase;">
                                                            <option value="M">Masculino</option>
                                                            <option value="F">Femenino</option>
                                                        </select>
                                                    </td>
                                                    <td><label/>Estado Civil</td>
                                                    <td>
                                                        <select name="ecivil" style="padding: 7px 6px;
                                            width: 130px;
                                            border: 1px solid #CED5D7;
                                            resize: none;
                                            box-shadow:0 0 0 3px #EEF5F7;
                                            margin: 5px 0;
                                            text-transform: uppercase;">
                                                            <option value="S">Soltero</option>
                                                            <option value="C">Casado</option>
                                                            <option value="D">Divorciado</option>
                                                            <option value="V">Viudo</option>
                                                        </select>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>LUGAR DE NACIMIENTO</legend>
                                            <table border="0">
                                                <tr>
                                                    <td><input type="text" name="Dep" id="dep" size="2" value="" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" name="Prov" id="prov" size="2" value="" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" name="Dist" id="dist" size="2" value="" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" name="Otro" id="otro" size="2" value="" style="width: 1.5em" maxlength="2">
                                                        <button type="button" style="width: 3em" id="ubinac" value="">:::</button>
                                                    </td>
                                                    <td><div id="Nubigeo" style="font-size:1.0em ;width: 5.0em;border: 1px solid #c4e9f8; width: 35.0em; height: 28px;background-color: #ffffff"></div></td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>LUGAR DE DOMICILIO</legend>
                                            <table border="0">
                                                <tr>
                                                    <td><input type="text" id="depd" name="Depd" size="2" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" id="provd" name="Provd" size="2" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" id="distd" name="Distd" size="2" style="width: 1.5em" maxlength="2"></td>
                                                    <td><input type="text" id="otrod" name="Otrod" size="2" style="width: 1.5em" maxlength="2">
                                                        <button type="button" id="ubidom" style="width: 3em">:::</button>
                                                    </td>
                                                    <td><div id="Nubigeod" style="font-size:1.0em ;width: 5.0em;border: 1px solid #c4e9f8; width: 35.0em; height: 28px;background-color: #ffffff"></div></td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label>DIRECCION</label></legend>
                                            <table border="0">
                                                <tr>
                                                    <td>
                                                        <select name="cdir" style="padding: 7px 6px;
                                            width: 130px;
                                            border: 1px solid #CED5D7;
                                            resize: none;
                                            box-shadow:0 0 0 3px #EEF5F7;
                                            margin: 5px 0;
                                            text-transform: uppercase;">
                                                            <%LinkedList<TipoDireccion> tdir = Lista.getlistaTipoDireccion();
                                                            for (int c = 0; c < tdir.size(); c++) {%>
                                                            <option value="<%=tdir.get(c).getCOD_DIR()%>"><%=tdir.get(c).getNOM_TIPO_DIR()%></option>
                                                            <%}%>
                                                        </select>
                                                
                                                        <br/><label>Jr/Av/Cl</label></td>
                                                    <td><input type="text" name="direccion" size="8" style="width: 35em"><br/><label>Nombre Jr/Av/Cl</label></td>
                                                    <td><input type="text" name="nro" size="2" style="width: 5.0em"><br/><label>Numero</label></td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label>OTROS DATOS</label></legend>
                                            <table border="0">
                                                <tr>
                                                    <td><input type="text" name="tel1" size="2" style="width: 7.0em"><br/><label>Telefono 1</label></td>
                                                    <td><input type="text" name="tel2" size="2" style="width: 7.0em"><br/><label>Telefono 2</label></td>
                                                    <td>
                                                        <select name="nacio" style="padding: 7px 6px;
                                            width: 180px;
                                            border: 1px solid #CED5D7;
                                            resize: none;
                                            box-shadow:0 0 0 3px #EEF5F7;
                                            margin: 5px 0;
                                            text-transform: uppercase;">
                                                            <%LinkedList<Nacionalidad> nac = Lista.getlistaNacionalidad();
                                                    for (int a = 0; a < nac.size(); a++) {%>
                                                            <option value="<%=nac.get(a).getCOD_NACIONALIDAD()%>"><%=nac.get(a).getNOM_NACIONALIDAD()%></option>
                                                            <%}%>
                                                        </select>
                                                        <br/><label>Nacionalidad</label>
                                                    </td>
                                                    <td>
                                                        <select name="tipoestadop" style="padding: 7px 6px;
                                            width: 230px;
                                            border: 1px solid #CED5D7;
                                            resize: none;
                                            box-shadow:0 0 0 3px #EEF5F7;
                                            margin: 5px 0;
                                            text-transform: uppercase;">
                                                            <%LinkedList<TipoEstadoPersona> test = Lista.getlistaEstadoPersona();
                                                    for (int b = 0; b < test.size(); b++) {%>
                                                            <option value="<%=test.get(b).getCOD_ESTADO_PERS()%>"><%=test.get(b).getNOM_ESTADO_PERS()%></option>
                                                            <%}%>
                                                        </select>
                                                        <br/><label>Restriccion</label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                        
                            </table>
                        </fieldset>
                    </td></tr>
                <tr>
                    <td colspan="4">
                        <div align="center">                  
                            <fieldset style="alignment-baseline: central; height: 4em">
                                <legend style="border: 1px solid #dce0e3;background-color: #edf1f5">BOTONES DE MANTENIMIENTO</legend>
                                <table>
                                    <tr>
                                        <td><button type="submit" name="btn1" value="guardapers" class="boton">Guardar</button></td>
                                        <td><button type="reset" name="btn1" value="cancelar" class="boton">Cancelar</button></td>
                                        <td><button type="button" name="btn1" value="menu" onclick="main()">Menu Principal</button></td>
                                    </tr>
                                </table>
                            </fieldset>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%String msj = (String) request.getAttribute("msj");
                            if (msj != null) {
                                if (msj == "1") {%>
                        <div>
                            <fieldset style="border-radius: 10px 10px 10px 10px; background-color: #fff5f6;border:1px solid #f57269">
                                <legend style="border-radius: 10px 10px 10px 10px; background-color: #fff5f6;border:1px solid #f57269"><img src="/RegCivil/imagenes/exclamation.png"> </legend>
                                <label>Error en almacenar el registro ingresado</label>
                            </fieldset>
                        </div>
                        <%}%>
                        <%} else {%>
                        <div>
                            <fieldset style="border-radius: 10px 10px 10px 10px; background-color: #fffbe7;border:1px solid #ffe954">
                                <label style="color:#edd00c; font-size: 1.0em ">Informacion de Almacenamiento</label>
                            </fieldset>
                        </div>
                        <%}%>
                    </td>
                </tr>
            </table>
                <button type="submit" name="btn1" value="matrimonio" class="style-btn boton-Matrimonio">Matrimonio</button>
                <button type="submit" name="btn1" value="defuncion" class="style-btn boton-Defuncion">Defuncion</button>
        </form>
    </body>
</html>
